<?php
/**
 * PatientSignalUpload3 model class file.
 *
 * @package   models
 * @since     1.0
 * @filesource
 */

/**
 * The 3rd form in uploading signal, contains interviewer information
 * 
 * PatientSignalUpload0 is a Form class. 
 * It is the data structure for keeping form data.
 *
 */
class PatientSignalUpload3 extends CFormModel{

	/**
	 * @var string
	 */
	public $interviewerName;
	/**
	 * @var string
	 */
	public $interviewerQualification;
	/**
	 * @var integer
	 */
	public $interviewerAccreditationReference;
	/**
	 * @var integer
	 */
	public $interviewerAccreditationDate;
	/**
	 * @var integer
	 */
	public $interviewerAccreditingInstituteLocation;
	/**
	 * @var integer
	 */
	public $interviewerAccreditingTrainerExaminer;
	
	/**
	 * Declares the validation rules.
	 * The rules will be used when requesting validation by call self.validate().
	 * Many class method will call self.validate(), eg: CActiveRecord.save().
	 * @return array validation rules for model attributes.
	 * @see PatientSignal
	 */
	public function rules()
	{
		return array(
			// duplicate the rules of mentioned attributes in PatientSignal
			array('interviewerName, interviewerQualification', 'required','on'=>'next'),
			array('interviewerAccreditationDate', 'default','value'=>null),
			array('interviewerAccreditationReference, interviewerAccreditingInstituteLocation,', 'safe'),
			array('interviewerName, interviewerQualification, interviewerAccreditationReference, 
				interviewerAccreditingInstituteLocation, interviewerAccreditingTrainerExaminer', 
				'length', 'max'=>255),
		);
	}

	/**
	 * Returns the labels for each column variables.
	 * This will be used to render label on page.
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'interviewerName' => 'Name',
			'interviewerQualification' => 'Qualification',
			'interviewerAccreditationReference' => 'Interviewer Accreditation Reference',
			'interviewerAccreditationDate' => 'Date of Accreditation',
			'interviewerAccreditingInstituteLocation' => 'Location of Accrediting Institute',
			'interviewerAccreditingTrainerExaminer' => 'Accrediting Trainer and Examiner ',
		);
	}
}
